let Mock = require('mockjs');       //引入mock

let newsList = Mock.mock({
  "newsList|11":[{
    id: '@increment',
    img_url: 'https://portrait.gitee.com/uploads/avatars/user/486/1460144_anur_1578952015.png!avatar200',
    title: '@ctitle(5, 10)',
    add_time: '@datetime',
    click: '@integer(60, 100)'
  }]
})

module.exports =  {
    getLunbotu: () =>{
        return Mock.mock({
            status: 0,
            'message|3': [
                {
                    img: 'src\\images\\234610-158402797018b3.jpg'
                    // img: 'http://pic.netbian.com/uploads/allimg/200312/234610-158402797018b3.jpg'
                }
            ]
        })
    },
  getList: () =>{
      return newsList
  },
  getDetail: () => {
    return Mock.mock({
      id: '@increment',
      title: '@ctitle(5, 10)',
      add_time: '@datetime',
      click: '@integer(60, 100)',
      content: '@ctitle(500)'
    })
  },
  getComments: () => {
    return Mock.mock({
      'comments|5': [{
        user_name:'@ctitle(2,5)',
        add_time: '@datetime',
        content: '@ctitle(3,10)'
      }]
    })
  },
  postComment: () => {
    return Mock.mock({
      msg: 'success'
    })
  }
}
